package com.source.thread;

public class ThreadDemo01 {

    public static void main(String[] args) throws InterruptedException {
        Ticket  t1= new Ticket();

        new Thread(()->{
            for (int i = 0; i < 10005; i++) {

              /*  try {
                    Thread.sleep(50);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } */
                t1.sell();
            }
        },"AA").start();
  Thread.sleep(20);

        new Thread(()->{
            for (int i = 0; i < 10005; i++) {
                t1.sell();



            }
        },"BB").start();
    }
}




